package com.accesshollywood.grfxOrdering.panels;

import java.awt.Component;
import java.awt.event.ActionListener;

import javax.swing.JCheckBox;

import com.accesshollywood.components.FoldablePanel;
import com.accesshollywood.indexables.GrfxOrder;

public class SingleOrderPanel extends FoldablePanel {
	public GrfxOrder model;

	// chckbxSecret:
	// only shows up if specific rights are available to user. Helps with
	// selecting things for editing or removal.
	//
	// send a class into secretClass, and its constructor will be called when
	// then checkbox is clicked. The constructor should accept a boolean
	// so the checkbox can tell it whether it is selected or not.
	//
	public JCheckBox							chckbxSecret;
	public ActionListener						secretListener;
	public boolean								useChckbxSecret	= false;
	
	
	public SingleOrderPanel(GrfxOrder model, OrderTree2 parent){
		super();
		this.parent = parent;
		this.model = model;
	}
	
	public void addSecretCheck(int i, ActionListener secretListener){
		this.useChckbxSecret = true;
		this.secretListener = secretListener;
		
		chckbxSecret = new JCheckBox(i + "");
		chckbxSecret.addActionListener(secretListener);
		((OrderDetailsPanel)foldUpPanel).approvalPanel.add(chckbxSecret,0);
	}
	
	public void setSecretCheck(boolean newValue){
		chckbxSecret.setSelected(newValue);
	}
}
